<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>日志管理</title>
    <link rel="stylesheet" type="text/css" th:href="@{/css/style.css}"/>
    <script type="text/javascript" th:src="@{/js/jquery.js}"></script>
    <script type="text/javascript" th:src="@{/laydate/laydate.js}"></script>
    <script type="text/javascript">
        function tipOpen(content) {
            $(".tipright p").text(content);
            $("#tip").fadeIn(200);
        }

        function tipClose() {
            $("#tip").fadeOut(200);
        }
    </script>
</head>
<body>
<div class="place"><span>位置：</span>
    <ul class="placeul">
        <li><a href="../users/userList.html">系统管理</a></li>
        <li><a href="#">日志管理</a></li>
    </ul>
</div>
<div class="rightinfo">
    <form th:action="@{/sys/journal/list}" method="post" id="logForm">
        <ul class="tools">
            <input type="hidden" id="pageNum" name="pageNum" value="1">
            <li><label>员工编号:</label>
                <input type="text" name="uId" th:value="${uId}"/>
            </li>
            <li><label>员工姓名:</label>
                <input type="text" name="uname" th:value="${uname}"/>
            </li>
            <li><label>日志内容：</label>
                <input type="text" name="jcontent" th:value="${jcontent}"/>
            </li>
            <li><label>操作模块：</label>
                <input type="text" name="moduleRname" th:value="${moduleRname}"/>
            </li>
            <li><label>记录时间:</label>
                <input type="date" class="laydate-icon" id="logStartTime" name="jdateBegin" th:value="${#dates.format(jdateBegin,'yyyy-MM-dd')}"/>
                <label>-</label>
                <input type="date" class="laydate-icon" id="logEndTime" name="jdateEnd" th:value="${#dates.format(jdateEnd,'yyyy-MM-dd')}"/>
            </li>
            <li class="subBut" onclick="goPage(1)"><img th:src="@{/images/t06.png}"/>查询</li>
            <li class="subBut" onclick="reset()"><img th:src="@{/images/t03.png}"/>重置</li>
        </ul>
        <table class="tablelist">
            <thead>
            <tr>
                <th>日志序号</th>
                <th>员工编号</th>
                <th>员工姓名</th>
                <th>操作模块</th>
                <th>日志内容</th>
                <th>记录时间</th>
                <th>其它操作</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="j,var:${jp.list}">
                <!--<td th:text="${(jp.pageNum-1)*jp.pageSize+var.count}">1</td>-->
                <td th:text="${j.jId}">1</td>
                <td th:text="${j.uId}">9527</td>
                <td th:text="${j.users.uname}">唐寅</td>
                <td th:text="${j.module.moduleRname}">用户管理</td>
                <td th:text="${j.jcontent}">进行了添加用户xxx的操作</td>
                <td th:text="${#dates.format(j.jdate,'yyyy-MM-dd HH:mm')}">2016-11-20 15:05:29</td>
                <td>
                    <a th:href="|/erp/sys/journal/details/${j.jId}|" class="tablelink">查看日志信息</a>
                </td>
            </tr>
            </tbody>
        </table>
        <div class="pagin">
            <div class="message">
                共<i class="blue" th:text="${jp.total}">1256</i>条记录，当前显示第&nbsp;<i class="blue" th:text="${jp.pageNum}">2&nbsp;</i>页
            </div>
            <ul class="paginList">
                <li class="paginItem">
                    <a href="javascript:void(0);" th:onclick="goPage([[${jp.isFirstPage?1:jp.pageNum-1}]])">
                        <span th:class="${jp.isFirstPage?'pagepre':'pagenxt roate'}"></span>
                    </a>
                </li>
                <li th:each="page : ${jp.navigatepageNums}"
                    th:class="${page==jp.pageNum?'paginItem current':'paginItem'}">
                    <a href="javascript:void(0);" th:onclick="goPage([[${page}]])" th:text="${page}">1</a>
                </li>
                <li class="paginItem">
                    <a href="javascript:void(0);"
                       th:onclick="goPage([[${jp.isLastPage?jp.pages:jp.pageNum+1}]])">
                        <span th:class="${jp.isLastPage?'pagepre roate':'pagenxt'}"></span>
                    </a>
                </li>
            </ul>
        </div>
    </form>
    <!-- 提示框 -->
    <div id="tip" class="tip">
        <div class="tiptop"><span>提示信息</span><a onclick="tipClose()"></a></div>
        <div class="tipinfo"><span><img src="../../images/ticon.png"/></span>
            <div class="tipright">
                <p></p>
                <cite>如果是请点击确定按钮 ，否则请点取消。</cite></div>
        </div>
        <div class="tipbtn">
            <input name="" type="button" class="sure" value="确定" onclick="tipClose()"/>
            &nbsp;
            <input name="" type="button" class="cancel" value="取消" onclick="tipClose()"/>
        </div>
    </div>
</div>
<script type="text/javascript">
    $('.tablelist tbody tr:odd').addClass('odd');

    function goPage(num) {
        //submit提交
        $("#pageNum").val(num);
        $("#logForm").submit();
    }

    function reset() {
        $(".tools>li>input").val("");
    }

    var start = {
        elem: '#logStartTime',
        format: 'YYYY-MM-DD hh:mm:ss',
        max: '2099-06-16', //最大日期
        istime: true,
        istoday: false,
        choose: function (datas) {
            end.min = datas; //开始日选好后，重置结束日的最小日期
            end.start = datas; //将结束日的初始值设定为开始日
        }
    };

    var end = {
        elem: '#logEndTime',
        format: 'YYYY-MM-DD hh:mm:ss',
        max: '2099-06-16',
        istime: true,
        istoday: false,
        choose: function (datas) {
            start.max = datas; //结束日选好后，充值开始日的最大日期
        }
    };
    laydate.skin('molv');//切换皮肤，请查看skins下面皮肤库
    laydate(start);
    laydate(end);
</script>
</body>
</html>
